package horsechess.client.data;

/**
 * @author Administrator
 * @version 2.2
 * @created 17-Apr-2011 11:50:30 AM
 */
public class CustomizeData {

    /**
     * The array of name of player
     */
    public String[] playerNames = new String[4];
    private int numberOfPlayer;
    /**
     * The image path of chessboard
     */
    private String pathImageChessBoard;
    /**
     * Two value number of dice that allow horse join in battle
     */
    private int[] startBattleValue = new int[2];
    /**
     * The array store destination values. The values is value of dice that allow
     * horse go to destination cell
     */
    private int[] finalValue = new int[2];
    /**
     * The number of dice on board
     */
    private int numberOfDice;
    /**
     * The number of horse on the board for each team
     */
    public int[] numberChessMan = new int[4];
    /**
     * The priority number present for order of player
     */
    private int priorityPerson;
    //private int score;

    //Properties
    /**
     * init numberOfPlayer with four
     * init priorityPerson with one
     * Set file path to pathImageChessBoard
     * set finalValue1 with 1 then assign to startBattleValue1
     * set finalValue1 with 6 then assign to startBattleValue1
     * set numberDice with 1
     * Assign random name to each player
     */
//    public CustomizeData() {
//        priorityPerson = 1;
//        pathImageChessBoard = "/resource/chessboard/ChessBoard.png";
//        setFinalValue1(1);
//        setStartBattleValue1(getFinalValue1());
//        setFinalValue2(6);
//        setStartBattleValue2(getFinalValue2());
//
//    }

  

    public void setDiceInfo(String msg){
         String[] strs = msg.split("#");
         numberOfDice=Integer.parseInt(strs[1]);
    }
    public void setPlayerNames(int pos, String playerName) {
        this.playerNames[pos] = playerName;
    }

    /**
     * The 1st value for begin battle of the horse
     */
    public int getStartBattleValue1() {
        return startBattleValue[0];
    }

    public void setStartBattleValue1(int startBattleValue) {
        this.startBattleValue[0] = startBattleValue;
    }

    /**
     * The 2nd value for begin battle of the horse in the cage
     */
    public int getStartBattleValue2() {
        return startBattleValue[1];
    }

    public void setStartBattleValue2(int startBattleValue) {
        this.startBattleValue[1] = startBattleValue;
    }

    /**
     * the 1st value allow an horse join destination cell
     */
    public int getFinalValue1() {
        return finalValue[0];
    }

    public void setFinalValue1(int value) {
        finalValue[0] = value;
    }

    /**
     * the 2nd value allow an horse join destination cell
     */
    public int getFinalValue2() {
        return finalValue[1];
    }

    public void setFinalValue2(int value) {
        finalValue[1] = value;
    }

    /**
     * The priority number present priority value of the person
     */
    public int getPriorityPerson() {
        return priorityPerson;
    }

    public void setPriorityPerson(int priorityPerson) {
        this.priorityPerson = priorityPerson;
    }

    /**
     * Number Of Players
     */
    public int getNumberOfPlayer() {
        return numberOfPlayer;
    }

    public void setNumberOfPlayer(int numberOfPlayer) {
        this.numberOfPlayer = numberOfPlayer;
    }

    /**
     * Image of chessboard
     * @return
     */
    public String getPathImageChessBoard() {
        return pathImageChessBoard;
    }

    public void setPathImageChessBoard(String pathImageChessBoard) {
        this.pathImageChessBoard = pathImageChessBoard;
    }

    /**
     * Number of Dice
     */
    public int getNumberOfDice() {
        return numberOfDice;
    }

    public void setNumberOfDice(int numberOfDice) {
        this.numberOfDice = numberOfDice;
    }

    /**
     * Get Number of chessman
     * @return
     */
    public int[] getNumberChessMan() {
        return numberChessMan;
    }

    public void setNumberChessMan(int[] numberChessMan) {
        this.numberChessMan = numberChessMan;
    }

    @Override
    /**
     * 1: PlayerName 1
     * 2: PlayerName 2
     * 3: PlayerName 2
     * 4: PlayerName 4
     * 5: PriorityPerson
     */
    public String toString() {
        return "@CData-" + playerNames[0] + "-" + playerNames[1]
                + "-" + playerNames[2] + "-" + playerNames[3] + "-" + priorityPerson;
    }


    public String getDiceInfo() {
        return "@Dice#" + numberOfDice;
    }
//    public int getScore() {
//        return score;
//    }
//
//    public void setScore(int score) {
//        this.score = score;
//    }
//
}
